package handling.opcode

import handling.WritableIntValueHolder

enum class PartyOpcode(private var type: Short) : WritableIntValueHolder {

    PartyReq_LoadParty(0),
    PartyReq_CreateNewParty(1),
    PartyReq_WithdrawParty(2),
    PartyReq_JoinParty(3),
    PartyReq_InviteParty(4),
    PartyReq_InviteIntrusion(5),
    PartyReq_KickParty(6),
    PartyReq_ChangePartyBoss(7),
    PartyReq_ApplyParty(8),
    PartyReq_SetAppliable(9),
    PartyReq_ClearIntrusion(10),
    PartyReq_CreateNewParty_Group(11),
    PartyReq_JoinParty_Group(12),
    PartyReq_PartySetting(13),
    PartyReq_LoadStarPlanetPoint(14),
    PartyRes_LoadParty_Done(19),
    PartyRes_CreateNewParty_Done(20),
    PartyRes_CreateNewParty_AlreayJoined(21),
    PartyRes_CreateNewParty_Beginner(22),
    PartyRes_CreateNewParty_Unknown(23),
    PartyRes_CreateNewParty_byNonBoss(24),
    PartyRes_WithdrawParty_Done(25),
    PartyRes_WithdrawParty_NotJoined(26),
    PartyRes_WithdrawParty_Unknown(27),
    PartyRes_JoinParty_Done(28),
    PartyRes_JoinParty_Done2(29),
    PartyRes_JoinParty_AlreadyJoined(30),
    PartyRes_JoinParty_AlreadyFull(31),
    PartyRes_JoinParty_OverDesiredSize(32),
    PartyRes_JoinParty_UnknownUser(33),
    PartyRes_JoinParty_Unknown(34),
    PartyRes_JoinIntrusion_Done(35),
    PartyRes_JoinIntrusion_UnknownParty(36),
    PartyRes_InviteParty_Sent(37),
    PartyRes_InviteParty_BlockedUser(38),
    PartyRes_InviteParty_AlreadyInvited(39),
    PartyRes_InviteParty_AlreadyInvitedByInviter(40),
    PartyRes_InviteParty_Rejected(41),
    PartyRes_InviteParty_Accepted(42),
    PartyRes_InviteIntrusion_Sent(43),
    PartyRes_InviteIntrusion_BlockedUser(44),
    PartyRes_InviteIntrusion_AlreadyInvited(45),
    PartyRes_InviteIntrusion_AlreadyInvitedByInviter(46),
    PartyRes_InviteIntrusion_Rejected(47),
    PartyRes_InviteIntrusion_Accepted(48),
    PartyRes_KickParty_Done(49),
    PartyRes_KickParty_FieldLimit(49),
    PartyRes_KickParty_Unknown(50),
    PartyRes_ChangePartyBoss_Done(53),
    PartyRes_ChangePartyBoss_NotSameField(54),
    PartyRes_ChangePartyBoss_NoMemberInSameField(55),
    PartyRes_ChangePartyBoss_NotSameChannel(56),
    PartyRes_ChangePartyBoss_Unknown(57),
    PartyRes_AdminCannotCreate(58),
    PartyRes_AdminCannotInvite(59),
    PartyRes_InAnotherWorld(60),
    PartyRes_InAnotherChanelBlockedUser(61),
    PartyRes_UserMigration(62),
    PartyRes_ChangeLevelOrJob(63),
    PartyRes_UpdateShutdownStatus(64),
    PartyRes_SetAppliable(63),
    PartyRes_SetAppliableFailed(64),
    PartyRes_SuccessToSelectPQReward(65),
    PartyRes_FailToSelectPQReward(66),
    PartyRes_ReceivePQReward(67),
    PartyRes_FailToRequestPQReward(68),
    PartyRes_CanNotInThisField(69),
    PartyRes_ApplyParty_Sent(70),
    PartyRes_ApplyParty_UnknownParty(71),
    PartyRes_ApplyParty_BlockedUser(72),
    PartyRes_ApplyParty_AlreadyApplied(73),
    PartyRes_ApplyParty_AlreadyAppliedByApplier(74),
    PartyRes_ApplyParty_AlreadyFull(75),
    PartyRes_ApplyParty_Rejected(76),
    PartyRes_ApplyParty_Accepted(77),
    PartyRes_FoundPossibleMember(78),
    PartyRes_FoundPossibleParty(79),
    PartyRes_PartySettingDone(83),
    PartyRes_Load_StarGrade_Result(81),
    PartyRes_Load_StarGrade_Result2(82),
    PartyRes_Member_Rename(83),
    PartyInfo_TownPortalChanged(85),
    PartyInfo_OpenGate(86),
    ExpeditionReq_Load(87),
    ExpeditionReq_CreateNew(88),
    ExpeditionReq_Invite(89),
    ExpeditionReq_ResponseInvite(90),
    ExpeditionReq_Withdraw(91),
    ExpeditionReq_Kick(92),
    ExpeditionReq_ChangeMaster(93),
    ExpeditionReq_ChangePartyBoss(94),
    ExpeditionReq_RelocateMember(95),
    ExpeditionNoti_Load_Done(96),
    ExpeditionNoti_Load_Fail(97),
    ExpeditionNoti_CreateNew_Done(98),
    ExpeditionNoti_Join_Done(99),
    ExpeditionNoti_You_Joined(100),
    ExpeditionNoti_You_Joined2(101),
    ExpeditionNoti_Join_Fail(102),
    ExpeditionNoti_Withdraw_Done(103),
    ExpeditionNoti_You_Withdrew(104),
    ExpeditionNoti_Kick_Done(105),
    ExpeditionNoti_You_Kicked(106),
    ExpeditionNoti_Removed(107),
    ExpeditionNoti_MasterChanged(108),
    ExpeditionNoti_Modified(109),
    ExpeditionNoti_Modified2(110),
    ExpeditionNoti_Invite(111),
    ExpeditionNoti_ResponseInvite(112),
    ExpeditionNoti_Create_Fail_By_Over_Weekly_Counter(113),
    ExpeditionNoti_Invite_Fail_By_Over_Weekly_Counter(114),
    ExpeditionNoti_Apply_Fail_By_Over_Weekly_Counter(115),
    ExpeditionNoti_Invite_Fail_By_Blocked_Behavior(116),
    AdverNoti_LoadDone(117),
    AdverNoti_Change(118),
    AdverNoti_Remove(119),
    AdverNoti_GetAll(120),
    AdverNoti_Apply(121),
    AdverNoti_ResultApply(122),
    AdverNoti_AddFail(123),
    AdverReq_Add(124),
    AdverReq_Remove(125),
    AdverReq_GetAll(126),
    AdverReq_RemoveUserFromNotiList(127),
    AdverReq_Apply(128),
    AdverReq_ResultApply(129),
    PP_NO(126);

    override fun getValue(): Short {
        return type
    }

    override fun setValue(newval: Short) {
        type = newval
    }

    companion object {
        fun getByAction(type: Short): PartyOpcode? {
            return PartyOpcode.values().firstOrNull { it.type == type }
        }
    }

}